You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND a.id_produtos_fabricante = AND b.num_ordem = 1 GROUP BY a.id_produtos ORDER' at line 1